package ink.lovejinhu.leetcode;

/**
 * @author jinhu
 * created 2021-08-03 8:30
 */
public class Solution_0706 {
    boolean[] Mykey = new boolean[1000009];
    int[] Myvalue = new int[1000009];

    /**
     * Initialize your data structure here.
     */
    public Solution_0706() {

    }

    /**
     * value will always be non-negative.
     */
    public void put(int key, int value) {
        Mykey[key] = true;
        Myvalue[key] = value;
    }

    /**
     * Returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key
     */
    public int get(int key) {
        if (Mykey[key]) {
            return Myvalue[key];
        } else {
            return -1;
        }
    }

    /**
     * Removes the mapping of the specified value key if this map contains a mapping for the key
     */
    public void remove(int key) {
        Mykey[key] = false;
    }
}
